<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>处理添加商品 - 后台管理</title>
</head>
<body>
    <h1>处理添加商品</h1>
    <p>正在处理添加商品请求...</p>
    
    <%
        // 实际项目中这里会处理表单提交的数据
        // 1. 获取表单参数
        // 2. 验证数据
        // 3. 调用ProductDao创建商品
        // 4. 返回结果或重定向到商品列表页面
        
        // 示例代码：
        /*
        String productName = request.getParameter("product_name");
        double price = Double.parseDouble(request.getParameter("price"));
        double salePrice = Double.parseDouble(request.getParameter("sale_price"));
        int typeId = Integer.parseInt(request.getParameter("type_id"));
        int status = Integer.parseInt(request.getParameter("status"));
        int isTop = Integer.parseInt(request.getParameter("is_top"));
        String logo = request.getParameter("logo");
        String idx = request.getParameter("idx");
        String intro = request.getParameter("intro");
        
        Product product = new Product();
        product.setProduct_name(productName);
        product.setPrice(price);
        product.setSale_price(salePrice);
        product.setType_id(typeId);
        product.setStatus(status);
        product.setIs_top(isTop);
        product.setLogo(logo);
        product.setIdx(idx);
        product.setIntro(intro);
        
        ProductDao productDao = new ProductDao(DBUtil.getConnection());
        productDao.createProduct(product);
        
        response.sendRedirect("product_list.jsp");
        */
    %>
    
    <script>
        // 模拟处理过程
        setTimeout(function() {
            alert("商品添加成功！");
            window.location.href = "product_list.jsp";
        }, 1000);
    </script>
</body>
</html>